<%--
  Created by IntelliJ IDEA.
  User: zzf
  Date: 2021/1/7
  Time: 19:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>--%>
<%@ include file="/public/header/permissionCommon.jspf" %>

<!DOCTYPE html>
<html>

<head>
    <title>角色档案</title>
    <style>
        .full-size {
            width: 100%;
            height: 100%;
        }
        .full-width {
            width: 100%;
        }
        .full-height {
            height: 100%;
        }
        .type-label{
            text-align: center;
            font-weight: bold;
            padding: 1px 4px;
            margin-left: 2px;
        }
    </style>
</head>

<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!-- 头部和左侧导航-->
    <div id="header"></div>
    <div class="layui-body">
    <div class="layui-tab layui-tab-brief" lay-filter="mainTab">
        <ul class="layui-tab-title">
            <li id="roleListLi" class="layui-this" lay-id="1">角色列表</li>
            <li id="editRoleLi" lay-id="2" class="layui-hide">编辑角色</li>
            <%--<li id="updateRoleLi" class="layui-hide" lay-id="3">更新角色</li>--%>
        </ul>
        <div class="layui-tab-content full-size">
            <div id="roleListDiv" class="layui-tab-item layui-show">
                <div class="layui-row full-width">
                    <button id="addRoleButton" class="layui-btn">新建</button>
                </div>
                <div class="layui-row full-width">
                    <table id="roleTable" lay-filter="roleTable" class="layui-table full-width"></table>
                </div>
            </div>
            <!-- 编辑 -->
            <div id="setRoleDiv" class="layui-tab-item">

                <form id="roleForm" class="layui-form" action="" lay-filter="roleForm">
                <%--<input type="hidden" id="permIds" name="permIds"/>--%>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">角色名称：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="roleName" lay-verify="required"
                                   autocomplete="off" class="layui-input"/>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">角色编号：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="code" lay-verify="required"
                                   autocomplete="off" class="layui-input"/>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">角色描述：</label>
                    <div class="layui-input-block">
                        <input type="text" name="descpt" lay-verify="" placeholder=""
                               autocomplete="off" class="layui-input"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">默认权限：</label>
                    <div class="layui-input-block">
                        <div id="permission-tree" lay-filter="permission-tree"></div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="roleSubmit">
                            提交
                        </button>
                        <button id="roleReset" type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
                </form>
            </div>
        </div>
    </div>

    <script type="text/html" id="roleTableLineToolLayer">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>


    <script type="text/javascript" src="${webPath}/js/permission/auth/permission-tree.js"></script>
    <script type="text/javascript" src="${webPath}/js/permission/auth/roleList.js"></script>

</div>
    <!-- 头部和左侧导航-->
    <div id="footer"></div>
</div>
</body>

<script>
    $("#header").load("${webPath}/publicPages/permission/fragments/header.jsp");
    $("#footer").load("${webPath}/publicPages/permission/fragments/footer.jsp");
</script>

</html>
